package com.tedu.bill.demo4;

import java.io.*;

/**
 * Author：毕龙
 * Date: 2024/5/28 9:24
 */
public class TestFile9 {
    public static void main(String[] args) throws IOException {
        //创建文件类对象
        File file = new File("day14/src/object.txt");


        //创建对象输出流
        AppendObjectOutputStream.initFile(file);

        AppendObjectOutputStream outputStream = new AppendObjectOutputStream(file);

        //创建对象
        User user = new User("zehao11", "478478");
        //写对象
        outputStream.writeObject(user);

        //关闭流
        outputStream.close();


    }
}
